<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <!-- 管道符 -->
    {{ uname | test | addval | haha }}
  </div>
  <script src="./vue.js"></script>
  <script>
    // 过滤器： 就是帮你吧数据进行操作返回
    Vue.filter('test', function(res) {
      console.log( res )
      // return res.split('').reverse().toString()
      return res.split('').reverse().join('!!!')
    })

    Vue.filter('addval', function(res) {
      return res + `~~~~~~~~` 
    })

    new Vue({
      el: '#app',
      data: {
        uname: '张三'
      },
      filters: {
        haha(res) {
          return res + '123123'
        }
      }
    })
  </script>
</body>
</html>